package algorithm.lanqiao.t17918;

import java.io.*;

public class Main {
    static InputStreamReader ins = new InputStreamReader(System.in);
    static BufferedReader br = new BufferedReader(ins);
    static StreamTokenizer in = new StreamTokenizer(ins);
    static PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) throws IOException {
        int n = readInt();
        while (n-- > 0) {
            String s = br.readLine();
            String s1 = s.replaceAll("[lqb]", "");
            StringBuilder sb = new StringBuilder(s1);
            StringBuilder reverse = sb.reverse();
            if (reverse.toString().equals(s1)) {
                out.println("Yes");
            } else {
                out.println("No");
            }
        }
        out.flush();
    }

    private static int readInt() {
        try {
            in.nextToken();
        } catch (Exception e) {
        }

        return (int) in.nval;
    }
}
